﻿<%@ Page Language="C#" MasterPageFile="~/HR/MasterPage.master" AutoEventWireup="true" CodeFile="Modify.aspx.cs" Inherits="HR_Modify" Title="无标题页" %>

<%@ Register Assembly="Coolite.Ext.Web" Namespace="Coolite.Ext.Web" TagPrefix="ext" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
     <script type="text/javascript">
        var template = '<span style="color:{0};">{1}</span>';

        var Shenhe = function (value) {
            if(value==0){return String.format(template,'red', '未审');}
            if(value==1){return String.format(template,'green', '同意');}
            if(value==2){return String.format(template,'blue', '退回');}
        }
    </script>
    <ext:Store ID="Store1" OnRefreshData="Store1_OnRefreshData" runat="server">
        <Reader>
            <ext:JsonReader ReaderID="id">
                <Fields>
                    <ext:RecordField Name="id" Type="Int"></ext:RecordField>
                    <ext:RecordField Name="ed_username" Type="String"></ext:RecordField>
                    <ext:RecordField Name="ed_deptname" Type="String"></ext:RecordField>
                    <ext:RecordField Name="intime" Type="Date"></ext:RecordField>
                    <ext:RecordField Name="adept_master_status" Type="Int"></ext:RecordField>
                    <ext:RecordField Name="dept_master_status" Type="Int"></ext:RecordField>
                    <ext:RecordField Name="boss_status" Type="Int"></ext:RecordField>
                    <ext:RecordField Name="guid" Type="String"></ext:RecordField>
                </Fields>
            </ext:JsonReader>
        </Reader>
         <AutoLoadParams>
             <ext:Parameter Name="start" Mode="Raw" Value="0" />
             <ext:Parameter Name="limit" Mode="raw" Value="20" />
         </AutoLoadParams> 
    </ext:Store>
<asp:SqlDataSource ID="SqlDataSource2" runat="server" 
                                ConnectionString="<%$ ConnectionStrings:CXDB %>" 
                                SelectCommand="SELECT [username], [uID] FROM [CX_UserBase] WHERE ([DEPID] = @DEPID)">
                                <SelectParameters>
                                    <asp:Parameter DefaultValue="3" Name="DEPID" Type="Int32" />
                                </SelectParameters>
                            </asp:SqlDataSource>
                            <ext:Store ID="Store2" DataSourceID="SqlDataSource2" runat="server">
                            <Reader>
                                <ext:JsonReader ReaderID="uID">
                                    <Fields>
                                        <ext:RecordField Name="uID" Type="Int"></ext:RecordField>
                                        <ext:RecordField Name="username" Type="String" ></ext:RecordField>
                                    </Fields>
                                </ext:JsonReader>
                            </Reader>
                            </ext:Store>
    <ext:ViewPort ID="ViewPort1" runat="server">
        <Body>
            <ext:ColumnLayout ID="ColumlayOut1" Split="true" FitHeight="true" runat="server"> 
            <Columns>
                <ext:LayoutColumn ColumnWidth="0.5">
                <ext:Panel ID="Panel1" Frame="true" runat="server">
                        <Body>
                    <ext:GridPanel  Frame="true" Height="500"  ID="GridPanel1" StoreID="Store1" Title="我提交的员工档案列表" TrackMouseOver="true" Icon="Attach" runat="server">
                    <ColumnModel>
                        <Columns>
                            <ext:Column ColumnID="id" DataIndex="id" Header="档案编号"></ext:Column>
                            <ext:Column ColumnID="ed_deptname" DataIndex="ed_deptname" Header="档案部门"></ext:Column>
                            <ext:Column ColumnID="ed_username" DataIndex="ed_username" Header="员工姓名"></ext:Column>
                            <ext:Column ColumnID="adept_master_status" DataIndex="adept_master_status" Header="人事领导">
                            <Renderer Fn="Shenhe" />
                            </ext:Column>
                            <ext:Column ColumnID="dept_master_status" DataIndex="dept_master_status" Header="部门领导">
                            <Renderer Fn="Shenhe" />
                            </ext:Column>
                            <ext:Column ColumnID="boss_status" DataIndex="boss_status" Header="公司领导">
                            <Renderer Fn="Shenhe" />
                            </ext:Column>
                            <ext:Column ColumnID="intime" DataIndex="intime" Header="提交时间">
                            <Renderer Fn="Ext.util.Format.dateRenderer('Y-m-d')" />
                            </ext:Column>
                            <ext:CommandColumn>
                                <Commands>
                                    <ext:GridCommand Text="删除" Icon="Delete"  CommandName="del">
                                                                                            
                                    </ext:GridCommand>
                                </Commands>
                            </ext:CommandColumn>
                            
                        </Columns>
                    </ColumnModel>
                    <SelectionModel>
                        <ext:RowSelectionModel ID="RowSelectionModel1" runat="server" SingleSelect="true">
                            <AjaxEvents>
                                <RowSelect OnEvent="RowSelect" Buffer="250">
                                    <EventMask ShowMask="true" Target="CustomTarget" CustomTarget="#{FormPanel1}" />
                                    <ExtraParams>
                                        <%-- or can use params[2].id as value --%>
                                        <ext:Parameter Name="id" Value="this.getSelected().id" Mode="Raw" /> 
                                    </ExtraParams>
                                </RowSelect>
                            </AjaxEvents>
                        </ext:RowSelectionModel>
                    </SelectionModel>
                    <AjaxEvents>
                        <Command OnEvent="DeleteRow" >
                        <Confirmation Title="确认信息" ConfirmRequest="true" Message="确认删除吗？"  />
                            <ExtraParams>
                                <ext:Parameter Name="id" Value="record.data.id" Mode="Raw">
                                </ext:Parameter> 
                            </ExtraParams>
                        </Command>
                     </AjaxEvents>
                  <BottomBar>
                        <ext:PagingToolBar 
                            ID="PagingToolBar1" 
                            runat="server" 
                            PageSize="20" 
                            StoreID="Store1" 
                            />
                    </BottomBar>
                    <LoadMask ShowMask="true" />
                    </ext:GridPanel>
                    
                        </Body>
                    </ext:Panel>
                </ext:LayoutColumn>
                <ext:LayoutColumn ColumnWidth="0.5">
                    <ext:Panel ID="Panel2" AutoScroll="true" runat="server"  >
                        <Body>
                        <ext:FormPanel AutoScroll="true" ID="FormPanel1" Title="员工诚信档案记录表"  runat="server" BodyStyle="padding:5px;" ButtonAlign="Right"
                                Frame="true" >
                                <Body>
                                    
                                    <ext:FormLayout ID="FormLayout1" runat="server">
                                        <ext:Anchor Horizontal="100%">
                                            <ext:Label ID="tflbusername" FieldLabel="员工姓名" runat="server">
                                            </ext:Label>
                                        </ext:Anchor>
                                        <ext:Anchor>
                                            <ext:Hidden ID="tfhiddenid" runat="server"></ext:Hidden>
                                        </ext:Anchor>
                                        <ext:Anchor>
                                            <ext:Hidden ID="tfhiddenguid" runat="server"></ext:Hidden>
                                        </ext:Anchor>  
                                        <ext:Anchor Horizontal="100%"> 
                                            <ext:Label ID="TfDeptName" FieldLabel="所在部门" runat="server">
                                            </ext:Label>
                                        </ext:Anchor> 
                                        <ext:Anchor>
                                            <ext:DateField ID="TfTalkTime"  Width="150" EmptyText="请选择时间"    FieldLabel="谈话时间" runat="server">
                                            </ext:DateField>
                                        </ext:Anchor>
                                        <ext:Anchor Horizontal="100%">
                                            <ext:TextArea ID="TfTalkContent" FieldLabel="谈话原因" runat="server">
                                            </ext:TextArea>
                                        </ext:Anchor>
                                        <ext:Anchor>
                                            <ext:DateField ID="TfPunish_party_time"  Width="150" FieldLabel="党纪政纪惩戒时间" runat="server">
                                            </ext:DateField>
                                        </ext:Anchor>
                                        <ext:Anchor>
                                            <ext:ComboBox ID="TfPunish_party_type" Editable="false" EmptyText="请选择"  Width="150" FieldLabel="党纪政纪惩戒类型" runat="server">
                                            <Items>
                                                <ext:ListItem Text="警告" />
                                                <ext:ListItem Text="严重警告" />
                                                <ext:ListItem Text="撤销党内职务" />
                                                <ext:ListItem Text="留党察看" />
                                                <ext:ListItem Text="开除党籍" />
                                            </Items>
                                            </ext:ComboBox>
                                             
                                        </ext:Anchor>
                                        <ext:Anchor Horizontal="100%">
                                            <ext:TextArea ID="TfPunish_party_reason" FieldLabel="党纪政纪惩戒原因" runat="server"></ext:TextArea>
                                        </ext:Anchor>
                                        <ext:Anchor>
                                            <ext:DateField ID="TfPunish_penal_time"  Width="150" EmptyText="请选择时间" FieldLabel="受刑事处罚时间" runat="server">
                                            </ext:DateField>
                                        </ext:Anchor>
                                        <ext:Anchor>
                                            <ext:ComboBox ID="TfPunish_penal_type" Editable="false" EmptyText="请选择"  Width="150" FieldLabel="受刑事处罚类型" runat="server">
                                            <Items>
                                                <ext:ListItem Text="管制" />
                                                <ext:ListItem Text="拘役" />
                                                <ext:ListItem Text="有期徒刑" />
                                                <ext:ListItem Text="无期徒刑" />
                                                <ext:ListItem Text="死刑" />
                                            </Items>
                                            </ext:ComboBox>
                                        </ext:Anchor>
                                        <ext:Anchor Horizontal="100%">
                                            <ext:TextArea ID="TfPunish_penal_reason" FieldLabel="受刑事处罚原因" runat="server"></ext:TextArea>
                                        </ext:Anchor>
                                        <ext:Anchor Horizontal="100%">
                                            <ext:TextArea ID="TfParty_Problem" FieldLabel="违反党风廉政建设的重大问题" runat="server"></ext:TextArea>

                                        </ext:Anchor>
                                        <ext:Anchor Horizontal="100%">
                                            <ext:TextArea ID="TfOther_Problem" FieldLabel="其他不良行为" runat="server"></ext:TextArea>
                                        </ext:Anchor>
                                        
                                        <ext:Anchor >
                                            <ext:FileUploadField runat="server" ID="tffileupload" Width="200" NoteAlign="Top" NoteCls="labelcls" Note="<p>如果有支持以上各项评价的相关证明文件请统一打包压缩作为附件上传，方便审核。<br>建议以说明性文字作为附件文件名。为节约服务器空间，附件仅支持.zip和.rar文件格式</p>" FieldLabel="附件"></ext:FileUploadField>
                                        </ext:Anchor> 
                                        <ext:Anchor >
                                            <ext:ComboBox 
                                                            FieldLabel="人事部领导" 
                                                            Width="150"
                                                            ID="TfaDept_MasterID" 
                                                            runat="server" 
                                                            StoreID="Store2" 
                                                            Editable="false"
                                                             Disabled="true" 
                                                            DisplayField="username"
                                                            ValueField="uID"
                                                            TypeAhead="true" 
                                                            Mode="Local"
                                                            ForceSelection="true"
                                                            EmptyText="请选择..."
                                                            Resizable="true"
                                                            SelectOnFocus="true">
                                            </ext:ComboBox>   
                                        </ext:Anchor>
                                        <ext:Anchor>
                                            <ext:Label runat="server" ID="TfaDept_master_entering_time" FieldLabel="审核时间"></ext:Label>
                                        </ext:Anchor>
                                        <ext:Anchor>
                                            <ext:Label runat="server" ID="TfaDept_master_status" FieldLabel="审核态度"></ext:Label>
                                        </ext:Anchor>
                                        <ext:Anchor>
                                            <ext:Label runat="server" ID="TfaDept_master_remark" FieldLabel="审核意见"></ext:Label>
                                        </ext:Anchor>
                                    </ext:FormLayout>
                                </Body>
                                <Buttons>
                                    <ext:Button ID="Button1"   runat="server" Icon="Disk" Text="修改提交">
                                    <AjaxEvents>
                                        <Click OnEvent="SubReportAdd">
                                            <EventMask ShowMask="true" Msg="员工诚信档案记录表提交中..." MinDelay="1000" />
                                        </Click>
                                    </AjaxEvents>
                                    </ext:Button>
                                </Buttons>
                            </ext:FormPanel>
                        </Body>
                    </ext:Panel>
                </ext:LayoutColumn>
            </Columns>
            </ext:ColumnLayout>
        </Body>
    </ext:ViewPort>
</asp:Content>

